package org.infoset.xml;

import java.net.*;

/**
 * This interface represents a construction facility for names.  This allows 
 * an implementation to cache names.
 * @author <a href="mailto:alex@milowski.com">R. Alexander Milowski</a>
 */
public interface NameTable {

   /**
    * Creates a namespace name URI from a string.
    * @param namespace The string representation of the URI.
    * @throws MalformedURIException Thrown when the representation does not conform to URI RFC rules.
    * @return A URI instance representing the namespace name.
    */
   URI createNamespace(String namespace)
      throws URISyntaxException;

   /**
    * Creates a namespace name URI from a character buffer.
    * @param buffer The character buffer containing the uri.
    * @param start The start index of the URI in the character buffer.
    * @param length The length of the URI in the character buffer.
    * @throws MalformedURIException Thrown when the representation does not conform to URI RFC rules.
    * @return A URI instance representing the namespace name.
    */
   //URI createNamespace(char [] buffer, int start, int length)
   //   throws MalformedURIException;

   /**
    * Creates a name instance from a character buffer.
    * @param namespace The namespace name to use.
    * @param buffer The buffer containing the local name.
    * @param start The index of the start of the local name.
    * @param length The length of the local name.
    * @return A name instance.
    */
   //Name createName(URI namespace,char [] buffer, int start, int length);

   /**
    * Creates a name instance from a string.
    * @param namespace The namespace name to use.
    * @param localName The string containing the local name.
    * @return A name instance.
    */
   Name createName(URI namespace,String localName);

   /**
    * Creates an unqualifed name instance from a character buffer.
    * @param buffer The buffer containing the local name.
    * @param start The index of the start of the local name.
    * @param length The length of the local name.
    * @return A name instance.
    */
   //Name createName(char [] buffer,int start,int length);

   /**
    * Creates an unqualifed name instance from a character buffer.
    * @param localName The string containing local name to use.
    * @return A name instance;
    */
   Name createName(String localName);

}
